package extends6constructor;

public class Student
{
    private String name;
    private char sex;
    private int age;
    private String SchoolName;
    public Student()
{

}
    public Student(String schoolName, int age, char sex, String name) {
        this.SchoolName = schoolName;
        this.age = age;
        this.sex = sex;
        this.name = name;
    }
    public Student(int age,char sex,String name)
    {
//        this.SchoolName = "北京工商大学";
//        this.sex = sex;
//        this.age = age;
//        this.name = name;
        this("北京工商大学",age,sex,name);

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSchoolName() {
        return SchoolName;
    }

    public void setSchoolName(String schoolName) {
        SchoolName = schoolName;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", sex=" + sex +
                ", age=" + age +
                ", SchoolName='" + SchoolName + '\'' +
                '}';
    }
}

